<template name="contract">
    <view class="contract">
        <view class="navigation">
            <image class="navigationIcon" src="../../static/arrow.png" mode="" @click="navigateBack"></image>
            <text class="navigationText">Account sccurity</text>
        </view>
        <view class="title">Permanently cancel account </view>
        <view class="main">
            <view class="subtitle">
                Before logging out, please confirm the following
            </view>
            <view class="content1">
                Canceling your account will result in the cancellation of your account functions on this platform, which
                will bring a lot of inconvenience to your after-sales rights protection. After the platform confirms that
                your account meets the following conditions, your account will be canceled:

            </view>
            <view class="content2">
                <view>
                    1. The account has no disputes, including complaints and reports, complaints and reports by others, and
                    lawsuits;
                </view>
                <view>
                    2. The account is an account in normal use and there is no record of account restriction;
                </view>
                <view>
                    3. There are no unfinished orders and services in the account;
                </view>
                <view>
                    4. The account has canceled the authorized login or binding relationship with other websites and other
                    APPs.
                </view>
            </view>
            <view class="content3">
                Once your personal account is canceled, you will not be able to log in and use this platform account. If you
                want to join this platform again in the future, this platform cannot assist you to restore the
                aforementioned services. Before submitting the cancellation application, please be sure to understand other
                relevant account information that needs to be unbound. For details, please contact our customer service.
            </view>

        </view>
        <view class="buttons" @click="logout">
            I agree to the above terms and apply for cancellation
            <text v-if="isLogout.show">
                ({{ isLogout.val }})
            </text>
        </view>
    </view>
</template>
  
<script>
import $_storage from '../../common/util/storage';
export default {
    name: 'contract',
    data() {

        return {
            isLogout: {
                val: '',
                show: true
            }

        };
    },
    methods: {
        // 点击注销
        logout: function () {
            if (this.isLogout.show) return;
            this.$http.get('/user/v1/del').then((res) => {
                if (res.data.status == 200) {
                    uni.removeStorageSync('userInfo')
                    uni.removeStorageSync('token')
					 uni.removeStorageSync("currentPage");
					  uni.removeStorageSync("backupcopyfirst");
							 uni.removeStorageSync("numbersa");
							  uni.removeStorageSync("times");
							    uni.removeStorageSync("one");
								  uni.removeStorageSync("twos");
								    uni.removeStorageSync("three");
                    // uni.navigateTo({ url: '/pages/login/login' })
					uni.reLaunch({
					  url: "/pages/login/login",
					});
                }
            })
        },
        // 返回
        navigateBack() {
            uni.navigateBack({
                delta: 1
            })
        },
    },
    mounted() {
        let time = 10;
        let timer = null;
        this.isLogout.val = time + 's'
        timer = setInterval(() => {
            if (time == 1) {
                clearInterval(timer)
                this.isLogout.show = false
            } else {
                time--;
                this.isLogout.val = time + 's'
            }
        }, 1000)
        // setInterval(()=>{})
    },
};
</script>
  
<style  scoped>
page {
    min-height: 100vh;
    padding-bottom: 24rpx;
}

.navigation {
    width: 100%;
    display: flex;
    align-items: center;
    text-align: center;
    padding: 80rpx 26rpx 20rpx;
    position: sticky;
    box-sizing: border-box;
    top: 0;
    background: #fff;
}

.navigationIcon {
    width: 32rpx;
    height: 38rpx;
}

.navigationText {
    width: 100%;
    font-size: 38rpx;
    font-weight: 400;
    color: #000;
    line-height: 54rpx;
    letter-spacing: 2rpx;
}

.contract {
    width: 100%;
    min-height: 100vh;
    box-sizing: border-box;
    background: rgba(248, 248, 248);
    display: flex;
    align-items: center;
    justify-content: flex-start;
    flex-direction: column;
    padding-bottom: 64rpx;

}

.contract .title {
    font-size: 40rpx;
    font-weight: bold;
    color: #000;
    margin-top: 80rpx;
    width: 100%;
    text-align: center;
}

.contract .main {
    padding: 20rpx 24rpx 24rpx;
    margin-top: 40rpx;
    width: calc(100% - 48rpx);
    background: #fff;
    border-radius: 16rpx;
    padding: 64rpx 38rpx 44rpx;
}

.contract .main .subtitle {
    padding: 0 48rpx;
    font-size: 32rpx;
    font-weight: bold;
    color: #000;
    text-align: center;

}

.contract .main .content1 {
    margin-top: 40rpx;
    font-size: 26rpx;
    font-weight: 400;
    color: #999;
    line-height: 54rpx;
}

.contract .main .content2 {
    font-size: 28rpx;
    font-weight: 400;
    color: #000;
    line-height: 54rpx;
}

.contract .main .content3 {
    font-size: 28rpx;
    font-weight: 400;
    color: #000;
    line-height: 54rpx;
}

.buttons {
    width: calc(100% - 48rpx);
    background: #000;
    border-radius: 128rpx;
    font-size: 38rpx;
    font-weight: 400;
    color: #fff;
    line-height: 40rpx;
    padding: 20rpx 48rpx;
    margin-top: 80rpx;
    text-align: center;
}


/* 头部额度部分 */
</style>
  